<script setup>

import Son from "@/ComponentCommunication/06-$refs与$parents/Son.vue";
import {ref} from "vue";

let data = ref(10086)
const c1 = ref()
// 修改孩子的数据
c1.value.toy = "小猪佩奇"

// 获取所有的子组件实例
function getAllChildren(children) {
  console.log(children)
  /**
   {
   c1:{
   data
   }
   }
   */
}
</script>

<template>
  <button @click="getAllChildren($refs)">按钮</button>
  <Son ref="c1"/>
</template>

<style scoped>

</style>